#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<string>

using std::cout;
using std::cin;
using std::endl;

#include"rbtree.h"
#include<assert.h>
int main() 
{
	srand(time(nullptr));
	/*RBTree<int> rbtree;
	rbtree.Insert(10);
	rbtree.Insert(9);
	rbtree.Insert(8);
	rbtree.Insert(7);
	rbtree.Insert(6);
	rbtree.Insert(5);
	rbtree.Insert(4);
	rbtree.Insert(3);*/

	/*for (int i = 0; i <= 10; i++)
	{
		if (auto ptr = rbtree.Find(i))
			cout << i << " " << endl;
	}*/


	/*RBTree<int> rbtree;
	rbtree.Insert(7790);
	rbtree.Insert(5398);
	rbtree.Insert(8854);
	rbtree.Insert(4942);*/

	/*RBTree<int> rbtree;
	rbtree.Insert(4000);
	rbtree.Insert(8854);
	rbtree.Insert(5000);
	assert(rbtree.IsValidRBTRee());*/

	RBTree<int> rbtree;
	for (int i = 0; i < 10000; i++)
	{
		int randn = rand() % 10000;
		if(i%1000==0)
			cout << randn << " ";
		rbtree.Insert(randn);
		assert(rbtree.IsValidRBTRee());
	}
	
	return 0;
}